export class TimeFunctionQueue {


    constructor(time = 0) {
        this.time = time; //定时器间隔时间
        //需要执行的方法数组
        this.funcutionArray = [];
        this.timeOut = null;
    }


    then(){

    }

    _startFunction(funcionCall,...argements) {

        if(typeof(funcionCall)==="function"){

            oldFunction=funcionCall;

            setTimeout(()=>{
                funcionCall();
                this.start();
            },this.time);
        }

    }





    start(){
        if(this.funcutionArray&&this.funcutionArray.length>0){
            this._startFunction(this.funcutionArray.shift());
        }
    }

    addFunction(func){
        this.funcutionArray.push(func);
    }




}

















